import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: () => import('@/views/Layout/LayoutIndex.vue'),
      children: [
        {
          path: '',
          component: () => import('@/views/Home/HomeIndex.vue'),
        },
        {
          path: 'Category/:id',
          component: () => import('@/views/Category/CategoryIndex.vue'),
        },
        {
          path: 'Category/subCategory/:id',
          component: () => import('@/views/SubCategory/SubCategoryIndex.vue'),
        },
        {
          path: 'Detail/:id',
          component: () => import('@/views/Detail/DetailIndex.vue'),
        },
        {
          path: '/gouwuche',
          component: () => import('@/views/cartList/CartLndex.vue'),
        },
        {
          path: '/checkout',
          component: () => import('@/views/Checkout/CheckLindex.vue'),
        },
         {
          path: '/pay',
          component: () => import('@/views/Pay/PayLindex.vue'),
        },
         {
          path: '/paycallback',
          component: () => import('@/views/Pay/PayBack.vue'),
        }
      ],
    },
    {
      path: '/login',
      component: () => import('@/views/Login/LoginIndex.vue'),
    }
  ],
  scrollBehavior() {
    return {
      top: 0,
    }
  },
})

export default router
